package org.ranshiyan.controller;

import org.ranshiyan.model.User;
import org.ranshiyan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.Cookie;
import java.util.List;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("list")
    public List<User> userlisy(){
       return userService.zlist();
    }

    @RequestMapping("updsum")
    public boolean updsum(){
        return userService.updsum();
    }

    @RequestMapping("login")
    public boolean login(@RequestBody User user){
        return userService.login(user);
    }

}
